/* vim: tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab
 *
 * theme.v1.css
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 * * Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above
 *   copyright notice, this list of conditions and the following disclaimer
 *   in the documentation and/or other materials provided with the
 *   distribution.
 * * Neither the name of the  nor the names of its
 *   contributors may be used to endorse or promote products derived from
 *   this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Authors:
 *   - Emily Gundry
 *   - Spencer McIntyre
 * Version: 1 (Gtk 3.10 - 3.18)
 *
 * For reference, the source to the default GTK theme Adwaita can be found here:
 * https://github.com/GNOME/gtk/tree/master/gtk/theme/Adwaita
 *
 * Complex widgets that are defined in gtk/ui (i.e. GtkFileChooserDialog) can
 * have their subwidget components and style classes inspected by reading
 * through their definitions in the .ui files located here:
 * https://github.com/GNOME/gtk/tree/master/gtk/ui
 */

/* two primary colors for mixing and one for highlighting */
@define-color theme_color_0 #00203a;
@define-color theme_color_1 #5d84a8;
@define-color theme_color_2 #00bf8c;
@define-color theme_color_bg shade(@theme_color_0, 1.2);

/* treeview normal */
@define-color theme_color_tv_bg @theme_color_0;
@define-color theme_color_tv_fg white;
/* treeview highlight */
@define-color theme_color_tv_hlbg @theme_color_2;
@define-color theme_color_tv_hlfg white;
/* treeview hover */
@define-color theme_color_tv_hobg @theme_color_1;
@define-color theme_color_tv_hofg white;
/* graph colors */
@define-color theme_color_graph_bg #254866;
@define-color theme_color_graph_fg #ffffff;
@define-color theme_color_graph_bar_bg #3c5b77;
@define-color theme_color_graph_bar_fg #c0dcff;
@define-color theme_color_graph_line_bg #92a4b3;
@define-color theme_color_graph_line_fg #002645;
@define-color theme_color_graph_map_land #3c5b77;
@define-color theme_color_graph_map_marker1 #ffc20f;
@define-color theme_color_graph_map_marker2 @theme_color_2;
@define-color theme_color_graph_map_water #c0dcff;
@define-color theme_color_graph_pie_high #c0dcff;
@define-color theme_color_graph_pie_low #3c5b77;

* {
  border: none;
  box-shadow: none;
  icon-shadow: none;
  text-shadow: none;
}

GtkAboutDialog GtkTextView,
GtkAboutDialog GtkViewport {
  background-color: @theme_color_bg;
  color: white;
}

GtkButton {
  background-image: linear-gradient(to bottom,
    mix(@theme_color_0, @theme_color_1, 0.75),
    @theme_color_0);
  background-size: 100% 100%;
  border-radius: 3px;
  border: 1px solid;
  border-color: @theme_color_0;
  color: mix(@theme_color_0, @theme_color_1, 0.25);
}

GtkButton:active,
GtkButton:hover,
GtkButton:selected {
  background-image: linear-gradient(to bottom,
    shade(alpha(@theme_color_1, 0.7), 1),
    shade(alpha(@theme_color_1, 0.7), 1.25));
  background-size: 100% 100%;
  color: @theme_color_0;
}

GtkButton:insensitive {
  background-color: alpha(mix(@theme_color_1, black, 0.5), 0.7);
  background-image: none;
}

GtkButtonBox {
  padding: 10px;
}

GtkCalendar {
  background-color: white;
  background-image: none;
  color: @theme_color_0;
}

GtkCalendar:insensitive {
  background-color: alpha(gray, 0.8);
  background-image: none;
  color: white;
}

GtkCalendar:insensitive:selected {
  background-color: alpha(lightgray, 0.8);
  background-image: none;
  color: white;
}

GtkCalendar:selected {
  background-color: @theme_color_2;
  background-image: none;
  color: white;
}

GtkCalendar .header {
  background-color: @theme_color_1;
  background-image: none;
  color: white;
}

GtkCheckButton.text-button {
  background-image: none;
  border-radius: 3px;
  border: 1px solid;
  border-color: @theme_color_1;
  color: mix(@theme_color_0, @theme_color_1, 0.25);
  padding: 1px 2px 4px;
}

GtkCheckButton.text-button:hover {
  background-color: alpha(@theme_color_0, 0.8);
  color: @theme_color_1;
}

GtkComboBox {
  color: white;
}

GtkComboBox .separator {
  -GtkWidget-wide-separators: true;
  -GtkWidget-horizontal-separator: 0;
  -GtkWidget-vertical-separator: 0;
}

GtkComboBox > GtkButton {
  color: white;
}

GtkEntry {
  background-color: alpha(white, 0.8);
  background-image: none;
  border-radius: 3px;
  color: @theme_color_0;
  padding: 5px 5px 6px;
}

GtkEntry:insensitive {
  background-color: alpha(darkgray, 0.8);
  background-image: none;
}

GtkEntry:selected {
  background-color: @theme_color_1;
  color: white;
}

GtkFileChooser .search-bar {
  background-color: @theme_color_bg;
  color: white;
}

GtkFileChooser .view {
  background-color: @theme_color_bg;
}

GtkFrame {
  background: none;
  border: 2px solid shade(@theme_color_0, 1.75);
}

GtkGrid {
  background: none;
}

GtkListBox {
  background-color: @theme_color_bg;
  color: white;
}

GtkMenuBar {
  background-color: mix(@theme_color_0, @theme_color_1, 0.4);
  color: white;
}

GtkMenuBar > GtkMenuItem {
  background-color: mix(@theme_color_0, @theme_color_1, 0.4);
  background-image: none;
}

GtkMenuBar > GtkMenuItem > GtkLabel {
  color: white;
}

GtkMenuItem {
  background-color: white;
  background-image: none;
  color: black;
}

GtkMenuItem > GtkLabel {
  color: black;
}

GtkMenuItem .accelerator {
  color: alpha(black, 0.4);
}

GtkMenuItem:hover {
  background-color: @theme_color_1;
  background-image: none;
  color: white;
}

GtkMenuItem:hover > GtkLabel {
  color: white;
}

GtkNotebook {
  background-color: @theme_color_bg;
  color: white;
  padding: 0px;
}

GtkPopover {
  background-color: mix(@theme_color_0, @theme_color_1, 0.4);
  color: white;
}

GtkProgressBar {
  background-image: none;
  background-color: white;
  color: white;
}

GtkProgressBar .progressbar {
  background-image: none;
  background-color: @theme_color_2;
  color: white;
}

GtkSwitch {
  -GtkSwitch-slider-height: 27px;
  -GtkSwitch-slider-width: 45px;
  font-size: smaller;
  font-weight: bold;
  outline-offset: -4px;
}

GtkSwitch.trough {
  border-radius: 3px;
  color: black;
  background-color: lightgray;
  background-image: none;
}

GtkSwitch.trough:active {
  background-color: @theme_color_2;
  background-image: none;
  color: white;
}

GtkSwitch.trough:insensitive {
  color: #8e9192;
  background-color: #f4f4f4;
}

GtkSwitch.trough:backdrop:insensitive {
  color: #c7c7c7;
  background-color: #f4f4f4;
}

GtkSwitch.slider {
  border-radius: 3px;
  background-image: linear-gradient(to bottom, #fafafa, #ededed 40%, #e0e0e0);
}

GtkTextView {
  background-color: @theme_color_bg;
  border-radius: 4px;
  color: white;
}

GtkTextView:selected {
  background-color: @theme_color_1;
  color: white;
}

GtkTreeView {
  background-color: @theme_color_tv_bg;
  color: @theme_color_tv_fg;
}

GtkTreeView .entry {
  padding: 0px;
}

GtkTreeView row:hover,
GtkTreeView row:selected {
  background-color: @theme_color_tv_hobg;
  color: @theme_color_tv_hofg;
}

GtkLabel {
  background: none;
  color: white;
  padding-left: 4px;
  padding-right: 4px;
}

GtkRadioButton {
  background-image: none;
}

GtkSpinButton {
  background-color: alpha(white, 0.8);
  background-image: none;
  color: @theme_color_0;
}

GtkToolButton,
GtkToolbar {
  background-color: @theme_color_1;
  background-image: none;
}

GtkViewport {
  background-color: @theme_color_bg;
}

GtkWindow {
  background-image: url("./background.svg");
  background-size: 100% 100%;
}

GtkWindow:active,
GtkWindow:hover {
  color: white;
}

/***********************************************************
 * Standard classes
 **********************************************************/

.notebook .header {
  border-width: 0px;
}

.notebook tab {
  padding: 4px 10px 5px 10px;
  background-color: transparent;
  background-image: none;
  border-color: transparent;
}

.notebook tab:active {
  background-image: linear-gradient(to bottom,
    shade(@theme_color_1, 1),
    shade(@theme_color_0, 1.25));
  border-radius: 4px 4px 2px 2px;
}

.sidebar {
  background-image: linear-gradient(to bottom,
    shade(@theme_color_1, 1.1),
    shade(@theme_color_0, 1.3));
}

.sidebar .highlight {
  background-image: linear-gradient(to bottom,
    shade(@theme_color_0, 1.25),
    shade(@theme_color_0, 1.50));
  color: white;
  font: bold;
}

.titlebar {
  background-color: mix(@theme_color_0, @theme_color_1, 0.4);
  background-image: none;
  color: white;
}

.tooltip {
  background-color: alpha(@theme_color_0, 0.8);
  background-image: none;
  border-radius: 5px;
}

/***********************************************************
 * Custom classes
 **********************************************************/
.background-add {
  background-image: url("./background.svg");
  background-size: 100% 100%;
  color: white;
}

.background-remove {
  background-image: none;
}

.multilineentry {
  background-color: alpha(white, 0.8);
  background-image: none;
  border: 0px;
  border-radius: 3px;
  padding: 5px 5px 6px; }
  .multilineentry:insensitive {
    background-color: alpha(darkgray, 0.8); }
  .multilineentry GtkTextView {
    background-color: transparent;
    background-image: none;
    color: @theme_color_0; }
    .multilineentry GtkTextView:selected {
      background-color: @theme_color_1;
      color: white; }
    .multilineentry GtkTextView:insensitive {
      background-color: alpha(darkgray, 0.8);
      background-image: none; }
